package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.MateProduceCodeInfo;
import com.ethink.warehouse.common.entity.MateProduceCode;

/**
 * 商品生产批次号 Converter转换器
 *
 * @author default
 * @date 2022-11-22
 */
@Component
public class MateProduceCodeConverter implements Converter<MateProduceCodeInfo, MateProduceCode> {

    @Override
    public MateProduceCode convertTo(MateProduceCodeInfo info) {
        if(info == null) {
            return null;
        }
        MateProduceCode entity = new MateProduceCode ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public MateProduceCodeInfo convertFrom(MateProduceCode entity) {
        if(entity == null) {
            return null;
        }
        MateProduceCodeInfo info = new MateProduceCodeInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
